package com.j177.cloud.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.client.RestTemplate;

/**
 * @Author:LuJiaHong
 * @Date:2020/11/30~17:48:49
 * @Version 1.0
 */
@RestController
@RequestMapping("/movie")
public class MovieController {
    @Autowired
    private RestTemplate restTemplate;

    @GetMapping(value = "/price")
    public Object price(String movieName,Integer priceNum){
        String result = restTemplate.getForEntity("http://localhost:8080/price/"+movieName+"/"+priceNum,String.class).getBody();
        return result;
    }
}
